package com.moyu.shopapp.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moyu.shopapp.entity.Goods;

import java.util.List;

/**
 * @author ZJF
 * @description 针对表【goods】的数据库操作Service
 * @createDate 2023-12-01 16:32:18
 */

public interface GoodsService extends IService<Goods> {

    Page<Goods> getAll(int pageNum,int pageSize);
    Page<Goods> getByKey(String searchKey,int pageNum,int pageSize);
    long getByKeyCount(String searchKey);

    List<String> getCategoryList();

    List<Goods> getByCategory(String category);

    String updateStockAndSales(int goodsId,int quantity,boolean status);

    boolean checkStock(int goodsId,int quantity);
}
